import logging

from pyleo.lib.base import *
import pyleo.lib.helpers as h

log = logging.getLogger(__name__)

class AccessController(BaseController):

    def _goback(self):
        p=dict(request.params)
        h.redirect_to(str(p['page']))

    def login(self):
        # Return a rendered template
        #   return render('/some/template.mako')
        # or, Return a response
        if not c.loginStatus:
            response.status_code=401
            return
        self._goback()
       
    def logout(self):
        self._goback()